#ifndef _RESOURCES_H_
#define _RESOURCES_H_

#include "TextureManager.h"
#include "AudioManager.h"
#include "AnimationManager.h"
#include "IniFile.h"

class Resources
{
public:
	typedef std::map<std::string, std::string> m_ss;
	typedef m_ss (Resources::*spriteDataFptr)(const std::string&);
	typedef void (Resources::*animLoadFptr)(AnimationManager&, const std::string&);

	static Resources* getSingletonPtr();
	static void cleanSingleton();

	void loadSprite(sf::Sprite&, const std::string&);
	void loadAudio(sf::Sound&, const std::string&);
	void loadAnimations(AnimationManager&, const std::string&);	
	
	void setMode(int, bool = false);		// Set resource loading model to archive or filepath, true or false to apply for Audio and Textures as well
	const int getResourceMode() { return _mode; }

private:
	Resources(void);
	~Resources(void);

	static Resources* _instance;

	inline m_ss getSpriteDataFromArchive(const std::string&);
	inline m_ss getSpriteDataFromFilepath(const std::string&);
	inline void loadAnimationsFromArchive(AnimationManager&, const std::string&);
	inline void loadAnimationsFromFilepath(AnimationManager&, const std::string&);

	void initializeResourcePaths();

	animLoadFptr _animLoadFptr[RESOURCE_SIZE];
	spriteDataFptr _spriteDataFptr[RESOURCE_SIZE];
	IniFile _resourcePaths;
	int _mode;
};

#endif // _RESOURCES_H_